//
//  HomePageBeforeListDetailCVC.m
//  YHYRealx
//
//  Created by yanghuiyan on 16/4/20.
//  Copyright © 2016年 yanghuiyan. All rights reserved.
//

#import "HomePageBeforeListDetailCVC.h"

@implementation HomePageBeforeListDetailCVC

- (void)dealloc {
    
    [_detailLabel release];
    [_pic release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.detailLabel = [YHYBaseLabel new];
        _detailLabel.numberOfLines = 0;
        _detailLabel.backgroundColor = [UIColor whiteColor];
        _detailLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:self.detailLabel];
        
        self.pic = [UIImageView new];
        [self.contentView addSubview:self.pic];
        
        [_detailLabel release];
        [_pic release];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _pic.frame = CGRectMake(0, 0, INWIDTH, 130);
    
    self.detailLabel.frame = CGRectMake(0, self.pic.bounds.size.height, INWIDTH , INHEIGHT - self.pic.bounds.size.height);
    
    
}

- (void)setDataModel:(HomePageDataModel *)dataModel {
    
    if (_dataModel != dataModel) {
        [_dataModel release];
        _dataModel = [dataModel retain];
    }
    [self.pic sd_setImageWithURL:[NSURL URLWithString:dataModel.hp_img_url]];
    
    self.detailLabel.text = dataModel.hp_content;
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
